import request from '@/utils/request'

const baseURL = 'http://localhost:39203/carbon/carbon_trade'

/**
 * 查询中国碳市场
 * @param data
 * @returns {AxiosPromise}
 */
export function queryMarketInfo(data) {
  return request({
    url: `/marketInfo/${data}`,
    method: 'post',
    data: data,
    baseURL: baseURL
  })
}

/**
 * 查询中国碳市场
 * @returns {AxiosPromise}
 */
export function queryCarbonAssertInfo() {
  return request({
    url: `/queryCarbonAssertInfo`,
    method: 'post',
    baseURL: baseURL
  })
}

/**
 * 查询当前碳资产
 * @returns {AxiosPromise}
 */
export function queryCurrentCarbonAssert() {
  return request({
    url: `/queryCurrentCarbonAssert`,
    method: 'post',
    baseURL: baseURL
  })
}

/**
 * 查询月度碳交易对比
 * @returns {AxiosPromise}
 */
export function queryCarbonTradeCompare() {
  return request({
    url: `/queryCarbonTradeCompare`,
    method: 'post',
    baseURL: baseURL
  })
}

/**
 * 查询月度碳交易对比
 * @returns {AxiosPromise}
 */
export function queryTradeList(data) {
  return request({
    url: `/queryTradeList`,
    method: 'post',
    data: data,
    baseURL: baseURL
  })
}

/**
 * 查询碳资产相关信息
 * @returns {AxiosPromise}
 */
export function queryCarbonAssert(data) {
  return request({
    url: `/queryCarbonAssert`,
    method: 'post',
    data: data,
    baseURL: baseURL
  })
}

/**
 * 查询碳资产相关信息
 * @returns {AxiosPromise}
 */
export function carbonAssertTrade(data) {
  return request({
    url: `/carbonAssertTrade`,
    method: 'post',
    data: data,
    baseURL: baseURL
  })
}

/**
 * carbonEmissionCompare
 * @returns {AxiosPromise}
 */
export function carbonEmissionCompare() {
  return request({
    url: `/carbonEmissionCompare`,
    method: 'post',
    baseURL: baseURL
  })
}

/**
 * queryNewPrice
 * @returns {AxiosPromise}
 */
export function queryNewPrice() {
  return request({
    url: `/queryNewPrice`,
    method: 'post',
    baseURL: baseURL
  })
}

/**
 * sellCarbon
 * @returns {AxiosPromise}
 */
export function sellCarbon(data) {
  return request({
    url: `/sellCarbon`,
    method: 'post',
    data: data,
    baseURL: baseURL
  })
}

/**
 * buyCarbon
 * @returns {AxiosPromise}
 */
export function buyCarbon(data) {
  return request({
    url: `/buyCarbon`,
    method: 'post',
    data: data,
    baseURL: baseURL
  })
}

/**
 * updateTrade
 * @returns {AxiosPromise}
 */
export function updateTrade() {
  return request({
    url: `/updateTrade`,
    method: 'post',
    baseURL: baseURL
  })
}
